# Menu 35 − AMC Cam

Mode: RFC‑S

Cam

Parameter | 35.001 AMC Cam Start Index
--- | ---
Short description | Defines which index of the cam table the AMC cam controller starts at
Mode | RFC‑S
Minimum | 0 | Maximum | 19
Default | 0 | Units |
Type | 8 Bit User Save | Update Rate | Read when the cam is enabled and each time the start or the end of the cam is reached.
Display Format | Standard | Decimal Places | 0
Coding | RW

Cam input
Initially the AMC Cam Index (35.007) and the AMC Cam Position In Segment (35.008) are set to the AMC Cam Start Index (35.001) and the AMC Cam Start Position In Segment (35.002). The Cam is enabled when the motion controller is enabled and AMC Reference Select (34.007) is changed to a value of 3. If AMC Cam Start Index (35.001) is equal to or greater than AMC Cam Size (35.003) or the AMC Cam Position In Segment (35.008) is larger than the Cam table input position change for the segment then a CAM.001 trip is initiated. This causes the drive to go into the trip state and the motion controller is disabled.

Any change of AMC Master Position (32.004) is used to move either forwards (positive changes) or in reverse (negative changes) through the Cam table. If AMC Disable Cam Table Parameters (36.0064) = 0 then the number of input user units for each segment are defined in the cam table parameters (36.005, 36.008, etc.), where AMC Cam Table Input 0 (36.005) corresponds to segment 0, etc. When the end of the segment is reached the AMC Cam Index (35.007) is incremented for forwards motion or decremented for reverse motion and the next or previous segment is used. When the end of segment AMC Cam Size (35.003) - 1 is reached going forwards the AMC Cam Index (35.007) wraps round to 0. When the start of segment 0 is reached going in reverse the AMC Cam Index (35.007) wraps round to segment AMC Cam Size (35.003) - 1.

It should be noted that if the change of input position causes the AMC Cam Index (35.007) to change by more than two segments then a CAM.002 trip is initiated. In addition, if the sum of the change of input position and AMC Cam Position In Segment (35.008) exceeds 109 user units a CAM.004 trip is initiated. These cause the drive to go into the trip state and the Advanced Motion Controller will be disabled.

Cam Output
The cam table parameters provide an output value and an interpolation method for each cam segment. AMC Cam Table Out 0 (36.005) and AMC Cam Table Interpolation 0 (36.006) correspond to segment 0, etc. As the AMC Cam Start Position In Segment (35.002) moves over the range from 0 to the value in AMC Cam Table In 0 (36.004) for segment 0 the output changes from 0 to the value in AMC Cam Table Out 0 (36.005). The change of position is fed out of the cam controller, the cam ratio is applied and the result is accumulated in the profile input integrator. Therefore for a given change of input position defined by AMC Cam Table In 0 (36.004) there is a change of output position defined by AMC Cam Table Out 0 (36.005) multiplied by the cam output ratio.

The interpolation method for each segment defines the relationship between the input and output positions. The interpolation functions are designed so that there are no speed discontinuities at segment boundaries, and so the rate of change of output position with respect to input position is the same either side of the segment boundaries. It is the responsibility of the user to ensure that the rate of change of the output is 0 at the end of the last segment to prevent a speed discontinuity as the cam table wraps round. The diagram below shows an example of interpolation within the Nth segment.

x is AMC Cam Start Position In Segment (35.002)

y is the output position

ΔXN is the cam input table value for the segment

ΔYN is the cam output table value for the segment

WN is dy/dx at the end of this segment

WN-1 is dy/dx at the end of the last segment

The following coefficients are calculated for each segment based on the rate of change of position at the end of the previous segment.

AN = WN-1 ΔXN

BN = ΔYN - AN

The output position is calculated using the following function.

y = (AN X) + (BN f(X))

where X is the input position as a proportion of the total input position over the segment, i.e. X = x/ΔXN. The term AN X produces a constant rate of change of output position against input position, and so if the input speed is constant this will provide a constant output speed that is equivalent to the speed at the start of the segment. This term prevents speed discontinuities between segments. The term BN f(X) produces the required change of output position ΔYN over the segment when combined with AN, using the required interpolation function f(X).Different functions can be used to give different types of interpolation, but f(0) must be 0 and f(1) must be 1 to give the correct output position change over the segment. The rate of change of output position with respect to the input position is given by

dy/dx = AN/ΔXN + BN df(X)/dx

It should be noted that the rate of change used internally by the motion controller is scaled by 256 and is rounded to the nearest integer. If the magnitude of the rate of change (dy/dx) at the end of any segment (WN-1) exceeds 231/256 a CAM.003 trip is initiated. This causes the drive to go into the trip state and the Advanced Motion Controller will be disabled.

Interpolation functions with no speed change
If WN = WN-1 then the speed at the start and end of the segment will be the same for a constant input speed. If the whole Cam table is filled with segments that use an interpolation method where this is true, then the speed will return to 0 at the end of every segment. Such a function can be selected if the Cam table interpolation parameter for a segment is set to 0 (Cos1). The following function is used:

f(X) = X - (1/(2π)) sin (2πX)

As already defined X = x / ΔXN, and so

f(X) = x/ΔXN - (1/(2π)) sin (2πx / ΔXN)

Differentiating with respect to x gives

df(X)/dx = (1 - cos (2πX)) / ΔXN

df(0)/dx = df(1)/dx = 0, and so WN = WN-1. The diagram below shows this function where WN-1 = WN = 0.

It should be noted that if ΔYN = AN then the output will be a constant speed for a constant speed input.

Interpolation functions that give a speed change
If it is not a requirement to have the same speed at the start and end of a segment then a function can be used where df(0)/dx = 0 and df(1)/dx = 2/ΔXN. In this case WN = AN + 2BN/ΔXN. Two such functions can be selected if the Cam table interpolation parameter for a segment is set to 1 (Square) or 2 (Cos2) as shown below.

For square interpolation f(X) = X2 which gives a linear change of dy/dx. The diagram below shows acceleration from 0. If ΔYN/ ΔXN is less than WN-1 at the start of the segment then dy/dx will fall over the segment and WN will be less than WN-1.

For the Cos2 interpolation f(X) = X - (1/π) sin (πX) which gives sinusoidal changes in dy/dx. The diagram below shows acceleration from 0. If ΔYN/ ΔXN is less than WN-1 at the start of the segment dy/dx will fall over the segment and WN will be less than WN-1.

Initial speed segment
One cam segment (AMC Cam Table In -1 (36.001), AMC Cam Table Out -1 (36.002), AMC Cam Table Interpolation -1 (36.003)) is provided to give an initial speed to the cam output. When the cam is enabled this segment becomes active and its output is added to the output provided by the main cam table. If AMC Cam Table Interpolation -1 (36.003) is set for Square or Cos2 interpolation then when the end of this segment is passed in the forward direction the output speed is maintained by applying a ratio of 2ΔY/ ΔX to the change of AMC Master Position (32.004). If the initial master speed is negative the input wraps around the end of the segment and will continue until the start of the segment is reached. Again the output speed is then maintained by applying a ratio of 2ΔY/ ΔX to the change of AMC Master Position (32.004). AMC Cam Table Interpolation -1 (36.003) can also be set up for linear interpolation, and if this is selected the initial speed cam segment always applies a ratio of ΔY/ ΔX to the change of AMC Master Position (32.004). If AMC Cam Table In -1 (36.001) is left at its default value of 0 then this initial segment is disabled and 0 is added to the main cam system.

Parameter | 35.002 AMC Cam Start Position In Segment
--- | ---
Short description | Defines the position in segment that the AMC Cam controller uses when the cam is enabled
Mode | RFC‑S
Minimum | 0 | Maximum | VM_AMC_POSITION_UNIPOLAR
Default | 0 | Units | UU
Type | 32 Bit User Save | Update Rate | Read when the cam is enabled and each time the start or the end of the cam is reached.
Display Format | Standard | Decimal Places | 0
Coding | RW, VM

See AMC Cam Start Index (35.001).

Parameter | 35.003 AMC Cam Size
--- | ---
Short description | Defines the number of segments from the cam table that are used to define the cam profile
Mode | RFC‑S
Minimum | 1 | Maximum | 20
Default | 1 | Units |
Type | 8 Bit User Save | Update Rate | Read when the cam is enabled and each time the start or the end of the cam is reached.
Display Format | Standard | Decimal Places | 0
Coding | RW

AMC Cam Size (35.003) defines the number of segments from the cam table that are used to define the cam profile. The cam table always starts in segment 0 and finishes at the end of segment AMC Cam Size (35.003) - 1.

Parameter | 35.004 AMC Cam Single Shot Enable
--- | ---
Short description | Set to 1 to disable the cam system from running continuously
Mode | RFC‑S
Minimum | 0 | Maximum | 1
Default | 0 | Units |
Type | 1 Bit User Save | Update Rate | 4ms read
Display Format | Standard | Decimal Places | 0
Coding | RW

If AMC Cam Single Shot Enable (35.004) = 0 then the cam runs continuously while it is selected. When either end of the cam table is reached the cam function will wrap around. If AMC Cam Single Shot Enable (35.004) = 1 the cam function output will stop when either end of the cam table is reached. For single shot operation the following apply:

1. The cam function cannot be started unless AMC Cam Complete (35.010) = 0. When the cam is complete and has stopped AMC Cam Complete (35.010) is set to 1. The cam function can be restarted again by clearing AMC Cam Complete (35.010).
2. Once the cam function has stopped it can be restarted by changing the AMC Reference Select (34.007) to a value other than 3 and then back to 3, or by disabling and re-enabling the motion controller.
3. Once the cam function has stopped it can be restarted by a freeze event (see AMC Action On Event (34.008)) provided the freeze event occurs in a sample after the one in which the cam function stopped.
4. The cam function is not stopped the first time it wraps around in reverse if it is selected or restarted with AMC Cam Start Index (35.001) = 0 and AMC Cam Start Position In Segment (35.002) = 0.

Parameter | 35.005 AMC Cam Output Ratio Numerator
--- | ---
Short description | Defines the numerator for the ratio that is applied to the change of output position from the Cam function
Mode | RFC‑S
Minimum | 1 | Maximum | 2147483647
Default | 1000 | Units |
Type | 32 Bit User Save | Update Rate | Background read
Display Format | Standard | Decimal Places | 0
Coding | RW

The Cam output ratio (AMC Cam Output Ratio Numerator (35.005) / AMC Cam Output Ratio Denominator (35.006)) is applied to the change of output position from the Cam function before it is accumulated by the profile input integrator.

Parameter | 35.006 AMC Cam Output Ratio Denominator
--- | ---
Short description | Defines the denominator for the ratio that is applied to the change of output position from the Cam function
Mode | RFC‑S
Minimum | 1 | Maximum | 2147483647
Default | 1000 | Units |
Type | 32 Bit User Save | Update Rate | Background read
Display Format | Standard | Decimal Places | 0
Coding | RW

See AMC Cam Output Ratio Numerator (35.005).

Parameter | 35.007 AMC Cam Index
--- | ---
Short description | Displays which index in the Cam table the Cam controller is using
Mode | RFC‑S
Minimum | 0 | Maximum | 19
Default |  | Units |
Type | 8 Bit Volatile | Update Rate | 4ms write
Display Format | Standard | Decimal Places | 0
Coding | RO, ND, NC, PT

See AMC Cam Start Index (35.001).

Parameter | 35.008 AMC Cam Position In Segment
--- | ---
Short description | Displays the position in the segment that the cam controller is using
Mode | RFC‑S
Minimum | 0 | Maximum | VM_AMC_POSITION_UNIPOLAR
Default |  | Units | UU
Type | 32 Bit Volatile | Update Rate | 4ms write
Display Format | Standard | Decimal Places | 0
Coding | RO, VM, ND, NC, PT

See AMC Cam Start Index (35.001).

Parameter | 35.009 AMC Cam Final Speed Coefficient
--- | ---
Short description | Displays the Final Speed Coefficient that the cam controller uses
Mode | RFC‑S
Minimum | -21474836.48 | Maximum | 21474836.47
Default |  | Units | UU
Type | 32 Bit Volatile | Update Rate | Background write
Display Format | Standard | Decimal Places | 2
Coding | RO, ND, NC, PT

For the cam to repeat without a speed discontinuity as the cam wraps around the last segment (AMC Cam Size (35.003) -1) the value of dy/dx at the end of the last segment must be zero. AMC Cam Final Speed Coefficient (35.009) shows the value of A0 which is calculated using the rate of change at the end of the last segment and AMC Cam Table In 0 (36.004), i.e. A0 = WN ΔX0. When AMC Force CAM Repeat (35.011) is enabled the rate of change at the boundary between the first and last segment is forced to zero when the cam is running in the forward direction or to the rate of change at the end of the last segment when it is running in reverse. This forces the interpolated output position to be identical every time the cam wraps around the last segment in either direction but will introduce a speed discontinuity when AMC Cam Final Speed Coefficient (35.009) > 0 as shown in the figure below.

If AMC Force CAM Repeat (35.011) is disabled and AMC Cam Final Speed Coefficient (35.009) > 0 the rate of change calculated at the end of the previous segment is used when the cam wraps around. This avoids introducing a speed discontinuity but the interpolated output position between segment boundaries will change when the cam repeats which is caused by the rate of change used at the beginning of segment 0 after the cam wraps around the final segment as shown in the figure below. This mode should only be used when writing cam table parameters (more than 20 points) from a controller.

Parameter | 35.010 AMC Cam Complete
--- | ---
Short description | Displays when the cam controller reaches the end of the cam table
Mode | RFC‑S
Minimum | 0 | Maximum | 1
Default | 0 | Units |
Type | 1 Bit Volatile | Update Rate | 4ms write
Display Format | Standard | Decimal Places | 0
Coding | RW

AMC Cam Complete (35.010) is set to one each time the cam function wraps around either end of the cam table. AMC Cam Complete (35.010) is not set the first time the cam function wraps around in reverse if it is selected or restarted with AMC Cam Start Index (35.001) = 0 and AMC Cam Start Position In Segment (35.002) = 0. 0 can be written to AMC Cam Complete (35.010) to clear the indication. If AMC Cam Single Shot Enable (35.004) = 0 then AMC Cam Complete (35.010) has no effect on the action of the cam system. If AMC Cam Single Shot Enable (35.004) = 1 then the Cam will not operate if AMC Cam Complete (35.010) = 1. The Cam can be restarted by clearing AMC Cam Complete (35.010).

Parameter | 35.011 AMC Force CAM Repeat
--- | ---
Short description |
Mode | RFC‑S
Minimum | 0 | Maximum | 1
Default | 1 | Units |
Type | 1 Bit User Save | Update Rate | Background read
Display Format | Standard | Decimal Places | 0
Coding | RW, BU

See AMC Cam Final Speed Coefficient (35.009).